export const loadFileAsync = (file: File): Promise<string | ArrayBuffer> =>
new Promise((resolve, reject) => {
    const fileReader = new FileReader();
    fileReader.readAsDataURL(file);
    fileReader.onload = (e) => {
        resolve(e.target?.result ? e.target.result : "");
    };
    fileReader.onerror = (e) => {
        reject(e);
    };
});
